package com.hgw.Demo01_ChainOfResponsibilityPattern.Exercises16_8_6;

/**
 * Data time:2021/12/16 16:34
 * StudentID:2019112118
 * Author:hgw
 * Description:
 */
public class Client {
    public static void main(String[] args) {
        Handler director,manager,generaManager;
        director = new Director("汪方旭");
        manager = new Manager("王远鹏");
        generaManager = new GeneralManager("黄龚伟");

        director.setSuccessor(manager);
        manager.setSuccessor(generaManager);

        LeaveRequest request1 = new LeaveRequest("小张", 1, "感冒了");
        director.handleLeave(request1);

        LeaveRequest request2 = new LeaveRequest("小春", 7, "回家看爸妈");
        director.handleLeave(request2);

        LeaveRequest request3 = new LeaveRequest("小谷", 30, "技术不行想回家休息");
        manager.handleLeave(request3);
    }
}
